import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class MC0312死亡名单 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        // 1. 读取 n
        int n = scanner.nextInt();

        // 2. 初始化名单 (使用 ArrayList)
        List<Integer> nameList = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            nameList.add(scanner.nextInt());
        }

        // 3. 读取 m
        int m = scanner.nextInt();

        // 4. 进行 m 次移除操作
        for (int i = 0; i < m; i++) {
            int idToRemove = scanner.nextInt();
            nameList.remove(idToRemove-1);
        }

        // 5. 输出最终名单
        for (int i = 0; i < nameList.size(); i++) {
            System.out.print(nameList.get(i)+" ");
        }
        scanner.close();
    }
}
